/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package base;

import java.io.File;

/**
 *
 * @author pbelov
 */
public class Tools {
    private static String DBPATH = "DB" + File.separator;
    private static String BUGSPATH = "bugs" + File.separator;
    private static String BUGFILESEXT = ".xml";

    public static void println(String str) {
        System.out.println(str);
    }

    public static String getFilePath(int bug) {
        String res = (DBPATH + BUGSPATH + Integer.toString(bug) + BUGFILESEXT);
        return res;
    }

    // Getting ID of "empty" bug (file isn't exists)
    public static int getLastBug() {
        int res = 0;

        while (true) {
            File tmp = new File(getFilePath(res));

            if (tmp.exists() == true) {
                res++;
            } else {
                break;
            }
        }

        return res;
    }
}